Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

chore(deps): upgrade to Yarn v2 #21

Merged
merged 1 commit into from
Sep 11, 2020
Merged

chore(deps): upgrade to Yarn v2 #21

merged 1 commit into from
Sep 11, 2020

Conversation

steabert
Copy link
Member

No description provided.

@steabert steabert force-pushed the yarn-v2 branch 9 times, most recently from f35b547 to 67caf91 Compare August 14, 2020 09:04
@steabert steabert requested a review from anius August 14, 2020 09:47
Copy link
Contributor

@anius anius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,2 @@
releases:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is used by yarn to mark version upgrades. When you create a PR, you just use

yarn version major --deferred

to indicate this will be a major update (as I did for this PR). This info will be stored by yarn in this file.
When you eventually release a new version, you will run

yarn version apply

and it will combine all the version updates that are marked in this file.
This is a way to circumvent the need to check commit messages for
conventional commits, the intended update will be marked with the
commit itself for yarn to use later.

@@ -0,0 +1,20 @@
enableGlobalCache: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had a comment before about Eslint and link to the issue, unnecessary now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still haven't solved the eslint issue, I was waiting if something would come along to fix this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you had a comment above this line before about ESLint but you've removed it in the latest patch so I was wondering if it was intended

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this one: yarnpkg/berry#965 (yarnpkg/berry#706).

However, I don't want to configure it that way, keeping it closer to the original behaviour.
If and when we want to enable this, we will run into that anyway.

sbin/release.sh Show resolved Hide resolved
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
Copy link
Contributor

@anius anius Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Would be great if this and next scripts were a separate npm package as I'm using them in react-hooks-shareable repo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add BREAKING CHANGES information as well when generating the changelog?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just copy the scripts, they are tiny. If we do something (much) more fancy we might consider having a separate project.

sbin/release.sh Outdated
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

VERSION=$(cat package.json | jq .version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Seems like current we need to update package.json version before running the script. Would be great if we got a prompt for the version or the version is updated based on the conventional commits

Copy link
Member Author

@steabert steabert Sep 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that version updates will be based on how a PR was "marked". With yarn v2 you can indicate the intended version upgrade. When you eventually do the upgrade, it will look at all those marks and find an appropriate new version number.
This script would then run after the yarn version apply so that it gets the new version number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some explanation now to the CONTRIBUTING.md file.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@steabert steabert force-pushed the yarn-v2 branch 5 times, most recently from 22dc616 to 27e0c29 Compare September 11, 2020 12:10
Uses eslint-config-typescript-shareable to import
linting rules from a shared config instead of specifying
own rules.

Temporary disabled global cache to avoid bug.

The conventional-commit-... tools don't work with Yarn v2,
so instead we generate the changelog with our own script.
@steabert steabert requested a review from anius September 11, 2020 14:18
@steabert steabert merged commit eff2bd7 into master Sep 11, 2020
@steabert steabert deleted the yarn-v2 branch September 11, 2020 14:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants